home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagg_m.zip / MISC.SWG / 0074_TOT Info.pas < prev    next >
Pascal/Delphi Source File  |  1994-01-27  |  3KB  |  92 lines

  1. {
  2. I've just "completed" (are programs *ever* completed?:) a rather
  3. large programming project for a 3rd year uni subject.
  4.  
  5. We chose to use TechnoJock's Object Toolkit (currently available
  6. version via Internet ftp) for much of the user interface (I'm
  7. sorry we didn't look at TurboVision, but that's another story),
  8. and I must admit that I was impressed with its overall
  9. functionality (I counted 87 different objects along with many
  10. useful non-object procedures), its ease of use and the generally
  11. flawless results it produced.
  12.  
  13. However, there is a MAJOR point that I would like to share with
  14. you all about this great toolkit that is NOT documented but
  15. ESSENTIAL to know about if you use it.
  16.  
  17. The problem was that after a program that uses TOT was run, the
  18. system became very unstable afterwards with memory problems,
  19. usually locking up or something similar when subsequent programs
  20. are run.
  21.  
  22. I solved this problem by calling all the destructor Done methods
  23. of all the active TOT objects, then disposing of those on the
  24. memory heap just before exiting the program.  Now the TOT docs
  25. actually discourages this, but they don't mention that it does
  26. indeed NEED to be done before termination of the program.
  27.  
  28. For example:
  29. }
  30.  
  31. uses
  32.   Crt, { Borland }
  33.   totINPUT,
  34.   totFAST,
  35.   totDir,
  36.   totIO1,
  37.   totMSG,
  38.   totKEY,
  39.   totWIN,
  40.   totLIST,
  41.   totLINK,
  42.   totLOOK,
  43.   totSYS,
  44.   totDATE;
  45.   { TechnoJocks }
  46.   { other units }
  47.  
  48. { Then later... }
  49.  
  50. procedure TidyUpMess;
  51. { shutdown procedure }
  52. begin
  53.   { Tidy up after ourselves }
  54.   dispose(myobjects, Done);
  55.   { Tidy up after TechnoJocks }
  56.   Mouse.Hide;                   { turn off the mouse }
  57.   Screen.CursOn;                { vain attempt to get a cursor back in DOS }
  58.   Screen.Done;                  { totFAST - the screen object is a variable}
  59.   Key.Done;                     { totINPUT }
  60.   Mouse.Done                    { totINPUT }
  61.   Dispose(ALPHABETtot,Done);    { totINPUT }
  62.   Dispose(LOOKtot,Done);        { totLOOK }
  63.   Dispose(MONITOR,Done);        { totSYS }
  64.   Dispose(IOtot,Done);          { totIO }
  65.   Dispose(DATEtot,Done);        { totDATE }
  66.   Dispose(SCROLLtot,Done);      { totFAST }
  67.   Dispose(SHADOWtot,Done);      { totFAST }
  68. end;
  69.  
  70. {
  71. This does the job nicely... no more problems (that I could find,
  72. anyway).  Note that the order of some of these calls is important.
  73.  
  74. The only problem that remains is that on dropping back to dos the
  75. cursor is no longer there (but only with command.com - NOT if
  76. 4dos is installed - _strange_ indeed).
  77.  
  78. BTW, does anybody have a nice fix for this missing cursor?
  79.  
  80. Hopefully somebody will find this hard-found information useful.
  81. If someone knows how to email or netmail the authors, then I'm
  82. sure that they would like to know about this too; all I've got
  83. about them is the following:
  84.  
  85.   TechnoJock Software, Inc.
  86.   PO Box 820927
  87.   Houston TX 77282
  88.   Enquiries (713) 493-6354
  89.   Compuserve ID: 74017,227
  90.   Fax: (713) 493-5872
  91. }
  92.